
IMAGE_LINGUAS = "en-us en-gb"

ALLWINNERLINUX_RELEASE ??= "snapshot"

DISTRO = "allwinnerdistro"
DISTRO_NAME = "Allwinner Linux (A Yocto Project Based Distro)"

DISTRO_VERSION = "4.3.2-${@bb.utils.contains('ALLWINNERLINUX_RELEASE', 'snapshot', 'snapshot-${DATE}', '${ALLWINNERLINUX_RELEASE}', d)}"
# Don't include the DATE variable in the sstate package signatures
DISTRO_VERSION[vardepsexclude] = "DATE"
DISTRO_CODENAME = "nanbield"

LICENSE_FLAGS_ACCEPTED += " non-commercial commercial"

SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}"
SDK_VERSION[vardepsexclude] = "DATE"
SDK_NAME = "${IMAGE_LINK_NAME}-${SDK_ARCH}"
SDKPATHINSTALL = "/opt/poky/${MACHINE}/${SDK_VERSION}"
# Don't include the DATE variable in the sstate package signatures
SDKPATHINSTALL[vardepsexclude] = "DATE"

PACKAGE_CLASSES = "package_rpm"

DISTRO_FEATURES:append = "${DISTRO_FEATURES_DEFAULT}"

DISTRO_FEATURES:append = " alsa "

DISTRO_FEATURES:append = " directfb "


# Make sure to provide all expected tools in SDK
AW_TOOLS_FOR_SDK = " \
    nativesdk-binutils \
    nativesdk-ncurses-libncursesw \
    "

# Add tools to build native application with SDK
# Currently mandatory for kernel and u-boot
AW_TOOLS_FOR_SDK:append = " \
    nativesdk-cpp-symlinks \
    nativesdk-gcc-symlinks \
    "

# For support of perl ansicolor
AW_TOOLS_FOR_SDK_PERL = " \
    nativesdk-perl-module-term-ansicolor \
    nativesdk-perl-module-encode \
    nativesdk-perl-module-encode-encoding \
    nativesdk-perl-module-encode-mime-header \
"

# For some scripts in kernel source code
AW_TOOLS_FOR_SDK_PERL:append = " \
    nativesdk-perl-module-file-spec-functions \
    nativesdk-perl-module-integer \
    nativesdk-perl-module-pod-text \
"

AW_TOOLS_FOR_SDK:append = " ${AW_TOOLS_FOR_SDK_PERL} "

# For support of python module for u-boot
AW_TOOLS_FOR_SDK:append = " \
    nativesdk-python3-dev \
    nativesdk-python3-setuptools \
    nativesdk-swig \
    nativesdk-dtc \
    nativesdk-flex \
    "

# For support of string convertion (iconv) in SDK
AW_TOOLS_FOR_SDK:append = " \
    nativesdk-glibc-gconv-utf-16 \
    nativesdk-glibc-gconv-utf-32 \
    "

# For support wayland-scanner in SDK
AW_TOOLS_FOR_SDK:append = " \
    nativesdk-wayland \
    "

# For Kernel yaml dependency
AW_TOOLS_FOR_SDK:remove = " \
    nativesdk-libyaml \
    nativesdk-libyaml-dev \
    "

# Make sure to append mkimage to SDK for kernel uImage build
AW_DEPENDENCIES_BUILD_FOR_SDK = " \
    ${@bb.utils.contains('KERNEL_IMAGETYPE', 'uImage', 'nativesdk-u-boot-mkimage', '', d)} \
    ${@bb.utils.contains('KERNEL_ALT_IMAGETYPE', 'uImage', 'nativesdk-u-boot-mkimage', '', d)} \
  "
# Make sure to append openssl to SDK for kernel-module and scripts build
AW_DEPENDENCIES_BUILD_FOR_SDK:append = " nativesdk-openssl-dev "

# Make sure to append bison to SDK for u-boot build
AW_DEPENDENCIES_BUILD_FOR_SDK:append = " \
    ${@bb.utils.contains('EXTRA_IMAGEDEPENDS', 'u-boot', 'nativesdk-bison', '', d)} \
  "

# for populate_sdk, we will have all the tools
TOOLCHAIN_HOST_TASK:append = " ${AW_TOOLS_FOR_SDK} "
TOOLCHAIN_HOST_TASK:append = " ${AW_DEPENDENCIES_BUILD_FOR_SDK} "
# for populate_sdk_ext, the tools are not desired as mandatory tools (aka basic
# tools for devtool)
TOOLCHAIN_HOST_TASK:remove:task-populate-sdk-ext = " ${AW_TOOLS_FOR_SDK} "
TOOLCHAIN_HOST_TASK:remove:task-populate-sdk-ext = " ${AW_DEPENDENCIES_BUILD_FOR_SDK} "
# buildtools is used only by populate_sdk_ext
# populate_sdk_ext = buildtools + uninative + layer
# buildtools: sdk part of esdk (like sdk generated by populate_sdk)
# uninative: basic tools for devtool
TOOLCHAIN_HOST_TASK:remove:pn-buildtools-tarball = " ${AW_TOOLS_FOR_SDK_PERL} "

